<?php

namespace app\configure\controller;

use app\configure\model\ConfigAssetsTypeModel;
use think\admin\Controller;
class Assets extends Controller
{
    /**
     * 当前操作数据库
     * @var string
     */
    private string $table = 'ConfigAssetsType';

    /**
     * 固定资产分类管理
     * @auth true
     * @menu true
     * @throws DataNotFoundException
     * @throws DbException
     * @throws ModelNotFoundException
     */
    public function index()
    {
        $this->title = '固定资产分类管理';
//        $this->type =$this->request->param('type', 'index');
        $this->_query(ConfigAssetsTypeModel::class)->like('name')->order('id desc')->page(true, true);
    }

    /**
     * 添加
     * @auth true
     * @throws ModelNotFoundException
     * @throws DataNotFoundException
     * @throws DbException
     */
    public function add()
    {
        $this->_form(ConfigAssetsTypeModel::class, 'form');
    }

    /**
     * 修改
     * @auth true
     * @throws ModelNotFoundException
     * @throws DataNotFoundException
     * @throws DbException
     */
    public function edit()
    {
        $this->_applyFormToken();
        $this->_form(ConfigAssetsTypeModel::class, 'form');
    }

    public function _form_filter()
    {

    }

    /**
     * 修改排序
     * @auth true
     * @throws DbException
     */
    public function sort()
    {
        $this->_save(ConfigAssetsTypeModel::class);
    }


    public function del()
    {
    }

    /**
     * 删除
     * @auth true
     * @throws DbException
     */
    public function remove()
    {
        $this->_delete(ConfigAssetsTypeModel::class);
    }
}